<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>PMU Functions for Armv8.1-M</title>
<title>CMSIS-Core (Cortex-M): PMU Functions for Armv8.1-M</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="cmsis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="printComponentTabs.js"></script>
<script type="text/javascript" src="cmsis_footer.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 46px;">
  <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">CMSIS-Core (Cortex-M)
   &#160;<span id="projectnumber">Version 5.6.0</span>
   </div>
   <div id="projectbrief">CMSIS-Core support for Cortex-M processor-based devices</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<div id="CMSISnav" class="tabs1">
    <ul class="tablist">
      <script type="text/javascript">
		<!--
		writeComponentTabs.call(this);
		//-->
      </script>
	  </ul>
</div>
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li>
      <li><a href="modules.html"><span>Reference</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__pmu8__functions.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#groups">Content</a> &#124;
<a href="#nested-classes">Data Structures</a> &#124;
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">PMU Functions for Armv8.1-M</div>  </div>
</div><!--header-->
<div class="contents">

<p>Functions that relate to the Performance Monitoring Unit.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Content</h2></td></tr>
<tr class="memitem:group__pmu8__events__armv81"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__events__armv81.html">PMU Events for Armv8.1-M</a></td></tr>
<tr class="memdesc:group__pmu8__events__armv81"><td class="mdescLeft">&#160;</td><td class="mdescRight">IDs for Armv8.1-M architecture defined events. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__pmu8__events__armcm55"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__events__armcm55.html">PMU Events for Cortex-M55</a></td></tr>
<tr class="memdesc:group__pmu8__events__armcm55"><td class="mdescLeft">&#160;</td><td class="mdescRight">IDs for additional events defined for Cortex-M55. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:group__pmu8__events__armcm85"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__events__armcm85.html">PMU Events for Cortex-M85</a></td></tr>
<tr class="memdesc:group__pmu8__events__armcm85"><td class="mdescLeft">&#160;</td><td class="mdescRight">IDs for additional events defined for Cortex-M85. <br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Data Structures</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structPMU__Type.html">PMU_Type</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Structure type to access the Performance Monitoring Unit (PMU).  <a href="structPMU__Type.html#details">More...</a><br/></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:gad19c25be8565f2791aca1a96d1847516"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#gad19c25be8565f2791aca1a96d1847516">PMU</a></td></tr>
<tr class="memdesc:gad19c25be8565f2791aca1a96d1847516"><td class="mdescLeft">&#160;</td><td class="mdescRight">PMU configuration struct.  <a href="#gad19c25be8565f2791aca1a96d1847516">More...</a><br/></td></tr>
<tr class="separator:gad19c25be8565f2791aca1a96d1847516"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ga618e7140a774ac2a31a59db4b7d13abc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga618e7140a774ac2a31a59db4b7d13abc">ARM_PMU_Enable</a> (void)</td></tr>
<tr class="memdesc:ga618e7140a774ac2a31a59db4b7d13abc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable the PMU.  <a href="#ga618e7140a774ac2a31a59db4b7d13abc">More...</a><br/></td></tr>
<tr class="separator:ga618e7140a774ac2a31a59db4b7d13abc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga74273d4a47cf1a5e99d857a3e8896f10"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga74273d4a47cf1a5e99d857a3e8896f10">ARM_PMU_Disable</a> (void)</td></tr>
<tr class="memdesc:ga74273d4a47cf1a5e99d857a3e8896f10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable the PMU.  <a href="#ga74273d4a47cf1a5e99d857a3e8896f10">More...</a><br/></td></tr>
<tr class="separator:ga74273d4a47cf1a5e99d857a3e8896f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga77ee08f0b3e77d4559cb79fde30d89e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga77ee08f0b3e77d4559cb79fde30d89e9">ARM_PMU_Set_EVTYPER</a> (uint32_t num, uint32_t type)</td></tr>
<tr class="memdesc:ga77ee08f0b3e77d4559cb79fde30d89e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set event to count for PMU event counter.  <a href="#ga77ee08f0b3e77d4559cb79fde30d89e9">More...</a><br/></td></tr>
<tr class="separator:ga77ee08f0b3e77d4559cb79fde30d89e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4288c08039886cd24eb2dd4e743fb97e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga4288c08039886cd24eb2dd4e743fb97e">ARM_PMU_CYCCNT_Reset</a> (void)</td></tr>
<tr class="memdesc:ga4288c08039886cd24eb2dd4e743fb97e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset cycle counter.  <a href="#ga4288c08039886cd24eb2dd4e743fb97e">More...</a><br/></td></tr>
<tr class="separator:ga4288c08039886cd24eb2dd4e743fb97e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga90527859e6f0ef980300c86c2916ee79"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga90527859e6f0ef980300c86c2916ee79">ARM_PMU_EVCNTR_ALL_Reset</a> (void)</td></tr>
<tr class="memdesc:ga90527859e6f0ef980300c86c2916ee79"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reset all event counters.  <a href="#ga90527859e6f0ef980300c86c2916ee79">More...</a><br/></td></tr>
<tr class="separator:ga90527859e6f0ef980300c86c2916ee79"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga22e481855ab257180e24f01a38623887"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga22e481855ab257180e24f01a38623887">ARM_PMU_CNTR_Enable</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga22e481855ab257180e24f01a38623887"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable counters.  <a href="#ga22e481855ab257180e24f01a38623887">More...</a><br/></td></tr>
<tr class="separator:ga22e481855ab257180e24f01a38623887"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga76c6f266544c53d93801cfb614155420"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga76c6f266544c53d93801cfb614155420">ARM_PMU_CNTR_Disable</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga76c6f266544c53d93801cfb614155420"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable counters.  <a href="#ga76c6f266544c53d93801cfb614155420">More...</a><br/></td></tr>
<tr class="separator:ga76c6f266544c53d93801cfb614155420"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gaaa18c27d39f5a55c1b621f5296b88112"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#gaaa18c27d39f5a55c1b621f5296b88112">ARM_PMU_Get_CCNTR</a> (void)</td></tr>
<tr class="memdesc:gaaa18c27d39f5a55c1b621f5296b88112"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read cycle counter.  <a href="#gaaa18c27d39f5a55c1b621f5296b88112">More...</a><br/></td></tr>
<tr class="separator:gaaa18c27d39f5a55c1b621f5296b88112"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga9768cbaffcf2c0b31febe96db91a85d8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga9768cbaffcf2c0b31febe96db91a85d8">ARM_PMU_Get_EVCNTR</a> (uint32_t num)</td></tr>
<tr class="memdesc:ga9768cbaffcf2c0b31febe96db91a85d8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read event counter.  <a href="#ga9768cbaffcf2c0b31febe96db91a85d8">More...</a><br/></td></tr>
<tr class="separator:ga9768cbaffcf2c0b31febe96db91a85d8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga70436b378b75bdfe3fcb47697d309a96"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga70436b378b75bdfe3fcb47697d309a96">ARM_PMU_Get_CNTR_OVS</a> (void)</td></tr>
<tr class="memdesc:ga70436b378b75bdfe3fcb47697d309a96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read counter overflow status.  <a href="#ga70436b378b75bdfe3fcb47697d309a96">More...</a><br/></td></tr>
<tr class="separator:ga70436b378b75bdfe3fcb47697d309a96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga18376f0e3829e93e99149847667e5864"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga18376f0e3829e93e99149847667e5864">ARM_PMU_Set_CNTR_OVS</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga18376f0e3829e93e99149847667e5864"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear counter overflow status.  <a href="#ga18376f0e3829e93e99149847667e5864">More...</a><br/></td></tr>
<tr class="separator:ga18376f0e3829e93e99149847667e5864"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga133168437a20566d319c78b751425c44"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga133168437a20566d319c78b751425c44">ARM_PMU_Set_CNTR_IRQ_Enable</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga133168437a20566d319c78b751425c44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Enable counter overflow interrupt request.  <a href="#ga133168437a20566d319c78b751425c44">More...</a><br/></td></tr>
<tr class="separator:ga133168437a20566d319c78b751425c44"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga731b6cd01c6eaa6f909164602f19d0bc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga731b6cd01c6eaa6f909164602f19d0bc">ARM_PMU_Set_CNTR_IRQ_Disable</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga731b6cd01c6eaa6f909164602f19d0bc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Disable counter overflow interrupt request.  <a href="#ga731b6cd01c6eaa6f909164602f19d0bc">More...</a><br/></td></tr>
<tr class="separator:ga731b6cd01c6eaa6f909164602f19d0bc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga27b07d38050a16ce416bfaf151a24944"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pmu8__functions.html#ga27b07d38050a16ce416bfaf151a24944">ARM_PMU_CNTR_Increment</a> (uint32_t mask)</td></tr>
<tr class="memdesc:ga27b07d38050a16ce416bfaf151a24944"><td class="mdescLeft">&#160;</td><td class="mdescRight">Software increment event counter.  <a href="#ga27b07d38050a16ce416bfaf151a24944">More...</a><br/></td></tr>
<tr class="separator:ga27b07d38050a16ce416bfaf151a24944"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<p>Functions that relate to the Performance Monitoring Unit. </p>
<p>The following functions support the Performance Monitoring Unit (PMU) that is available on the Cortex-M55/M85 processors.</p>
<p>The PMU is used to monitor events that occur during run-time of an application.</p>
<p><b>Example:</b> </p>
<div class="fragment"><div class="line"><span class="comment">// Initialize counter variables</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> cycle_count = 0;</div>
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> l1_dcache_miss_count = 0;</div>
<div class="line"><span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> instructions_retired_count = 0;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Enable the PMU</span></div>
<div class="line"><span class="comment">// Note: Before using the PMU, software needs to ensure </span></div>
<div class="line"><span class="comment">// that trace is enabled via the Debug Exception Monitor Control Register, DEMCR:</span></div>
<div class="line"><span class="comment">// CoreDebug-&gt;DEMCR |= CoreDebug_DEMCR_TRCENA_Msk;</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga618e7140a774ac2a31a59db4b7d13abc">ARM_PMU_Enable</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Configure Event Counter Register 0 to count instructions retired</span></div>
<div class="line"><span class="comment">// Configure Event Counter Register 1 to count L1 D-Cache misses</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga77ee08f0b3e77d4559cb79fde30d89e9">ARM_PMU_Set_EVTYPER</a>(0, <a class="code" href="group__pmu8__events__armv81.html#ga8a5e60eee460addfc66e275a2c4c4800">ARM_PMU_INST_RETIRED</a>);</div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga77ee08f0b3e77d4559cb79fde30d89e9">ARM_PMU_Set_EVTYPER</a>(1, <a class="code" href="group__pmu8__events__armv81.html#ga4687d5d7efc6f49db2db9acc25b590f6">ARM_PMU_L1D_CACHE_MISS_RD</a>);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Reset Event Counters and Cycle Counter</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga90527859e6f0ef980300c86c2916ee79">ARM_PMU_EVCNTR_ALL_Reset</a>();</div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga4288c08039886cd24eb2dd4e743fb97e">ARM_PMU_CYCCNT_Reset</a>();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Start incrementing Cycle Count Register and Event Counter Registers 0 &amp; 1</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga22e481855ab257180e24f01a38623887">ARM_PMU_CNTR_Enable</a>(PMU_CNTENSET_CCNTR_ENABLE_Msk|PMU_CNTENSET_CNT0_ENABLE_Msk|PMU_CNTENSET_CNT1_ENABLE_Msk);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Code you want to measure here</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">// Stop incrementing Cycle Count Register and Event Counter Registers 0 &amp; 1</span></div>
<div class="line"> </div>
<div class="line"><a class="code" href="group__pmu8__functions.html#ga76c6f266544c53d93801cfb614155420">ARM_PMU_CNTR_Disable</a>(PMU_CNTENCLR_CCNTR_ENABLE_Msk|PMU_CNTENCLR_CNT0_ENABLE_Msk|PMU_CNTENCLR_CNT1_ENABLE_Msk);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Get cycle count, number of instructions retired and number of L1 D-Cache misses (on read)</span></div>
<div class="line"> </div>
<div class="line">cycle_count = cycle_count + <a class="code" href="group__pmu8__functions.html#gaaa18c27d39f5a55c1b621f5296b88112">ARM_PMU_Get_CCNTR</a>();</div>
<div class="line">instructions_retired_count = instructions_retired_count + <a class="code" href="group__pmu8__functions.html#ga9768cbaffcf2c0b31febe96db91a85d8">ARM_PMU_Get_EVCNTR</a>(0);</div>
<div class="line">l1_dcache_miss_count = l1_dcache_miss_count + <a class="code" href="group__pmu8__functions.html#ga9768cbaffcf2c0b31febe96db91a85d8">ARM_PMU_Get_EVCNTR</a>(1);      <span class="comment">// Note: D-Cache must be enabled using</span></div>
<div class="line">                                                                          <span class="comment">// SCB_EnableDCache() for meaningful result.</span></div>
</div><!-- fragment --> <h2 class="groupheader">Macro Definition Documentation</h2>
<a class="anchor" id="gad19c25be8565f2791aca1a96d1847516"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define PMU</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>PMU configuration struct. </p>
<p>This macro can be used to access the PMU registers, directly. For the common tasks one should prefer using the control functions.</p>
<p>Example: <b>Example:</b> </p>
<div class="fragment"><div class="line"><a class="code" href="group__pmu8__functions.html#gad19c25be8565f2791aca1a96d1847516">PMU</a>-&gt;CTRL |= PMU_CTRL_ENABLE_Msk; <span class="comment">// Enable PMU</span></div>
</div><!-- fragment --> 
</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="ga76c6f266544c53d93801cfb614155420"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_CNTR_Disable </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable counters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counters to enable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Disables one or more of the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga22e481855ab257180e24f01a38623887"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_CNTR_Enable </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable counters. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counters to enable </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Enables one or more of the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga27b07d38050a16ce416bfaf151a24944"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_CNTR_Increment </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Software increment event counter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counters to increment </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Software increment bits for one or more event counters (0-30) </dd></dl>

</div>
</div>
<a class="anchor" id="ga4288c08039886cd24eb2dd4e743fb97e"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_CYCCNT_Reset </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset cycle counter. </p>

</div>
</div>
<a class="anchor" id="ga74273d4a47cf1a5e99d857a3e8896f10"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Disable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable the PMU. </p>

</div>
</div>
<a class="anchor" id="ga618e7140a774ac2a31a59db4b7d13abc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Enable </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable the PMU. </p>

</div>
</div>
<a class="anchor" id="ga90527859e6f0ef980300c86c2916ee79"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_EVCNTR_ALL_Reset </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Reset all event counters. </p>

</div>
</div>
<a class="anchor" id="gaaa18c27d39f5a55c1b621f5296b88112"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t ARM_PMU_Get_CCNTR </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read cycle counter. </p>
<dl class="section return"><dt>Returns</dt><dd>Cycle count </dd></dl>

</div>
</div>
<a class="anchor" id="ga70436b378b75bdfe3fcb47697d309a96"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t ARM_PMU_Get_CNTR_OVS </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read counter overflow status. </p>
<dl class="section return"><dt>Returns</dt><dd>Counter overflow status bits for the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga9768cbaffcf2c0b31febe96db91a85d8"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> uint32_t ARM_PMU_Get_EVCNTR </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>num</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Read event counter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>Event counter (0-30) to read </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Event count </dd></dl>

</div>
</div>
<a class="anchor" id="ga731b6cd01c6eaa6f909164602f19d0bc"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Set_CNTR_IRQ_Disable </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Disable counter overflow interrupt request. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counter overflow interrupt request bits to clear </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Clears overflow interrupt request bits for one or more of the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga133168437a20566d319c78b751425c44"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Set_CNTR_IRQ_Enable </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Enable counter overflow interrupt request. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counter overflow interrupt request bits to set </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Sets overflow interrupt request bits for one or more of the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga18376f0e3829e93e99149847667e5864"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Set_CNTR_OVS </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>mask</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear counter overflow status. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">mask</td><td>Counter overflow status bits to clear </td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>Note</dt><dd>Clears overflow status bits for one or more of the following:<ul>
<li>event counters (0-30)</li>
<li>cycle counter </li>
</ul>
</dd></dl>

</div>
</div>
<a class="anchor" id="ga77ee08f0b3e77d4559cb79fde30d89e9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="group__compiler__conntrol__gr.html#gaba87361bfad2ae52cfe2f40c1a1dbf9c">__STATIC_INLINE</a> void ARM_PMU_Set_EVTYPER </td>
          <td>(</td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>num</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">uint32_t&#160;</td>
          <td class="paramname"><em>type</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set event to count for PMU event counter. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">num</td><td>Event counter (0-30) to configure </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>Event to count </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">
      <script type="text/javascript">
        <!--
        writeFooter.call(this);
        //-->
      </script>    
    </li>
  </ul>
</div>
</body>
</html>
